var qrcode = new QRCode(document.getElementById("qr-img"), {
  width: 240,
  height: 240,
});
var inputDom = document.getElementById("url-text");
chrome.tabs.query({ currentWindow: true, active: true }, function (tab) {
  console.log(tab);
  var url = tab[0]?.url;
  if (!url) {
    return;
  }

  create_qr(url);
  inputDom.value = url;
});
inputDom.onkeydown = function (e) {
  create_qr(e.target.value);
};
function create_qr(url) {
  qrcode.makeCode(url);
}
